#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:set sts=4:tabstop=4:expandtab:shiftwidth=4:
# EasyUbuntu - Install commonly requested apps on your (k/X)ubuntu box 
# Copyright (C) 2006 EasyUbuntu team
# https://launchpad.net/products/easyubuntu
# http://easyubuntu.freecontrib.org
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
# 

import os
import sys
from EasyUbuntu import detect

def main():
    # do the system sanity check. if it fails, just exit
    succeeded = detect.system_sanity_check()
    if not succeeded:
        print "EasyUbuntu will not run before these errors are fixed. Please fix them and try again"
        sys.exit(1)
    try:
        from EasyUbuntu import config
        datadir = config.pkgdatadir
        version = config.VERSION
    except:
        datadir = '.'
        version = '3.0.90'
    confdir = os.path.join(datadir, 'conf')
    detect.replace(confdir)
    if detect.de() == 'gnome':
        from EasyUbuntu import gtkfrontend
        gtkfrontend.launcher(datadir, confdir)
    else:
        from EasyUbuntu import qtfrontend
        qtfrontend.launcher(datadir, confdir)

if __name__ == '__main__':
    main()
